#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/11/2 19:17
# @Author  : 作者名
# @Site    :
from tornado import web, ioloop
from tornado.options import define, options, parse_config_file


# python 命令行传递参数.py  --port=9002
# 定义key


class IndexHandler(web.RequestHandler):
    async def get(self):
        self.write('tornado!!hkjh99')


class Login(web.RequestHandler):
    def get(self):
        # self.redirect('/v')
        self.reverse_url('index')


if __name__ == '__main__':
    app = web.Application(
        [
            web.URLSpec('/v', IndexHandler, name='index'),
            web.URLSpec('/v1', Login),
            web.URLSpec('/index/',Login,{"url":'/'})

        ],
        debug=True)  # 创建APP对象,设置路由
    app.listen(9001)  # 监听端口
    ioloop.IOLoop.current().start()  # 开始事件循环
